package com.stress.testing.common.interceptor;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class InterceptorClassLoaderHolder {
    private static final Map<URL, InterceptorClassLoader> INTERCEPTOR_CLASS_LOADER_MAP;

    static {
        INTERCEPTOR_CLASS_LOADER_MAP = new HashMap<>();
    }

    public static InterceptorClassLoader getInterceptorClassLoader(URL jarUrl) {
        return INTERCEPTOR_CLASS_LOADER_MAP.get(jarUrl);
    }

    public static void setInterceptorClassLoader(URL jarUrl, InterceptorClassLoader interceptorClassLoader) {
        INTERCEPTOR_CLASS_LOADER_MAP.put(jarUrl, interceptorClassLoader);
    }
}
